package com.myapp.Activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;

import com.myapp.R;
import com.myapp.utils.ClickUtils;
import com.myapp.utils.PreferencesUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

import static com.myapp.Activity.LoginActivity.LOGIN_NAME;

public class UserCenterActivity extends BaseActivity {
    private static final String TAG = "UserCenterActivity";

    private String name;

    @BindView(R.id.tv_telephone)
    TextView tvTelephone;
    @BindView(R.id.cl_user)
    ConstraintLayout clUser;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_center);
        ButterKnife.bind(this);
        name = PreferencesUtil.getInstance(getApplicationContext()).getString(LOGIN_NAME,null);
        if (name!=null){
            tvTelephone.setText(name);
        } else {
            tvTelephone.setText(" ");
        }
    }

    @Override
    protected void onResume() {
        super.onResume();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
    }

    @OnClick( R.id.cl_user)
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.cl_user:

                Intent intent = new Intent(this,UserInfoActivity.class);
                startActivity(intent);
                break;
        }
    }
}
